import java.util.Scanner;

//面试题
public class ChoirStrength {

    private static boolean canAchieveStrength(int[] abilities, int k, int l, int target) {
        int n = abilities.length;
        int count = 0;
        int i = 0;

        while (i < n) {
            if (abilities[i] >= target) {
                i++;
            } else {
                int j = Math.min(i + l, n);
                count++; // 需要一次训练
                for (; i < j; i++) {
                    abilities[i] = target;
                }
                if (count > k) {
                    return false;
                }
            }
        }
        return true;
    }

    public static int maxChoirStrength(int n, int k, int l, int[] abilities) {
        int left = 1;
        int right = 0;

        // 找到数组中的最大值
        for (int ability : abilities) {
            right = Math.max(right, ability);
        }

        int result = 0;

        while (left <= right) {
            int mid = left + (right - left) / 2;

            if (canAchieveStrength(abilities.clone(), k, l, mid)) {
                result = mid;
                left = mid + 1;
            } else {
                right = mid - 1;
            }
        }

        return result;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int l = scanner.nextInt();
        int[] abilities = new int[n];

        for (int i = 0; i < n; i++) {
            abilities[i] = scanner.nextInt();
        }

        System.out.println(maxChoirStrength(n, k, l, abilities));
    }
}

